﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Press.MVC.Services;

namespace Press.MVC.Tests
{
    [TestClass]
    public class AuthenticationTest
    {
        [TestMethod]
        public void AuthenticationService_Service_Can_Authenticate_Using_UserName_And_Password()
        {
            IAuthenticationService authService = new TestAuthenticationService();
            bool isAuthenticated = authService.IsValidLogin("haighis", "password");
            Assert.IsTrue(isAuthenticated);
        }

        [TestMethod]
        public void AuthenticationService_Service_Fails_Using_Invalid_UserName_And_Password()
        {
            IAuthenticationService authService = new TestAuthenticationService();
            bool isAuthenticated = authService.IsValidLogin("asdfasdf", "asdfasdf");
            Assert.IsFalse(isAuthenticated);
        }

    }
}
